package com.chexiehui.jc.entity;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

public class CarPkListInfo implements Serializable {
    private String specId;// (string, optional): 车型id ,
    private String seriesId;// (string, optional): 车系id ,
    private String specName;// (string, optional): 车型名称 ,
    private List<CarPkGroupInfo> groupParamsViewModelList;// (Array[CarPkGroup], optional): 对比数据
    private List<CarPkGroupParamInfo> allParamList;

    public String getSpecId() {
        return specId == null ? "" : specId;
    }

    public void setSpecId(String specId) {
        this.specId = specId;
    }

    public String getSeriesId() {
        return seriesId == null ? "" : seriesId;
    }

    public void setSeriesId(String seriesId) {
        this.seriesId = seriesId;
    }

    public String getSpecName() {
        return specName == null ? "" : specName;
    }

    public void setSpecName(String specName) {
        this.specName = specName;
    }

    public List<CarPkGroupInfo> getGroupParamsViewModelList() {
        return groupParamsViewModelList == null ? groupParamsViewModelList = new ArrayList<>() : groupParamsViewModelList;
    }

    public void setGroupParamsViewModelList(List<CarPkGroupInfo> groupParamsViewModelList) {
        this.groupParamsViewModelList = groupParamsViewModelList;
    }

    public List<CarPkGroupParamInfo> getAllParamValue(){
        if(allParamList == null){
            allParamList = new ArrayList<>();
            if(groupParamsViewModelList != null){
                for (int i = 0; i < groupParamsViewModelList.size(); i++) {
                    allParamList.addAll(groupParamsViewModelList.get(i).getParamList());
                }
            }
        }
        return allParamList;
    }

}
